package com.calvin.springcloud.feign.user;

import java.util.List;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import com.calvin.springcloud.base.ResponseResult;
import com.calvin.springcloud.feign.user.fallback.UserFeignFallbackFactory;
import com.calvin.springcloud.model.user.User;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;



@FeignClient(name="provider-user",fallbackFactory=UserFeignFallbackFactory.class)//对应eureka的实例名
public interface UserFei {
	
	@GetMapping("/user/getUserList")//地址一定要与服务提供者的请求地址保持一致
	public ResponseResult<List<User>> getUserList();
	
	@GetMapping(value="/user/findUser/{userId}/{userName}")
	public ResponseResult<User> findUser(@PathVariable(value="userId") Long userId,@PathVariable(value="userName") String userName);
	
	@GetMapping(value = "/user/getUserList/timeout")
	public ResponseResult<Object> getUserListTimeOut();
	
}
